package fr.adfm.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class BonCommandeDto implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;
	private ClientDto client;
	private List<BonCommandeLigneDto> lignes;
	private AdresseDto adresseLivraison;
	private Date dateCreation;
	private Double fraisDePort;
	private Double montantTotal;


	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Double getMontantTotal() {
		return montantTotal;
	}

	public void setMontantTotal(Double montantTotal) {
		this.montantTotal = montantTotal;
	}

	public ClientDto getClient() {
		return client;
	}

	public void setClient(ClientDto clientDto) {
		client = clientDto;
	}

	public List<BonCommandeLigneDto> getLignes() {
		return lignes;
	}

	public void setLignes(List<BonCommandeLigneDto> lignes) {
		this.lignes = lignes;
	}

	public AdresseDto getAdresseLivraison() {
		return adresseLivraison;
	}

	public void setAdresseLivraison(AdresseDto adresseLivraison) {
		this.adresseLivraison = adresseLivraison;
	}

	public Date getDateCreation() {
		return dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	


	public BonCommandeDto(Long id, ClientDto client,
			List<BonCommandeLigneDto> lignes, AdresseDto adresseLivraison,
			Date dateCreation, Double fraisDePort, Double montantTotal) {
		super();
		this.id = id;
		this.client = client;
		this.lignes = lignes;
		this.adresseLivraison = adresseLivraison;
		this.dateCreation = dateCreation;
		this.fraisDePort = fraisDePort;
		this.montantTotal = montantTotal;
	}

	public Double getFraisDePort() {
		return fraisDePort;
	}

	public void setFraisDePort(Double fraisDePort) {
		this.fraisDePort = fraisDePort;
	}

	public BonCommandeDto() {
	}

	@Override
	public String toString() {
		String data =  "BonCommandeDto [id=" + id + ", lient=" + client.getNom()
				+ ", adresseLivraison="
				+ adresseLivraison.getVille() + ", dateCreation=" + dateCreation
				+ ", fraisDePort=" + fraisDePort + ", prixTotal=" + montantTotal
				+ "]";
		
		for(BonCommandeLigneDto ligne : lignes) {
			data +=  ligne.toString();
		}
		
		return data;
	}
	

}
